package com.shoppingmalltest.shoppingmalltest.order.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.shoppingmalltest.shoppingmalltest.order.entity.PayLogEntity;
import com.shoppingmalltest.shoppingmalltest.order.service.PayLogService;
import com.shoppingmalltest.common.utils.PageUtils;
import com.shoppingmalltest.common.utils.R;



/**
 * 支付日志表
 *
 * @author libo
 * @email 1666737385@qq.com
 * @date 2020-07-25 23:14:07
 */
@RestController
@RequestMapping("order/paylog")
public class PayLogController {
    @Autowired
    private PayLogService payLogService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("order:paylog:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = payLogService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("order:paylog:info")
    public R info(@PathVariable("id") String id){
		PayLogEntity payLog = payLogService.getById(id);

        return R.ok().put("payLog", payLog);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("order:paylog:save")
    public R save(@RequestBody PayLogEntity payLog){
		payLogService.save(payLog);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
   // @RequiresPermissions("order:paylog:update")
    public R update(@RequestBody PayLogEntity payLog){
		payLogService.updateById(payLog);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
   // @RequiresPermissions("order:paylog:delete")
    public R delete(@RequestBody String[] ids){
		payLogService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
